import uniHelper from '@uni-helper/eslint-config'

export default uniHelper({
  unocss: true,
  vue: true,
  markdown: false,
  ignores: [
    'src/uni_modules/',
    'dist',
    'auto-import.d.ts',
    'uni-pages.d.ts',
    'src/pages.json',
    'src/manifest.json',
    'src/service/app/**',
  ],
  rules: {
    'no-tabs': 'error',
    'no-console': 'off',
    'no-unused-vars': 'off',
    'vue/no-unused-refs': 'off',
    'unused-imports/no-unused-vars': 'off',
    'eslint-comments/no-unlimited-disable': 'off',
    'jsdoc/check-param-names': 'off',
    'jsdoc/require-returns-description': 'off',
    'ts/no-empty-object-type': 'off',
    'no-extend-native': 'off',
    'indent': ['error', 2],

    // Vue 特定规则
    'vue/max-attributes-per-line': 'off',
    'vue/singleline-html-element-content-newline': 'off',
    'vue/multiline-html-element-content-newline': 'off',
    'vue/html-self-closing': 'off',
    'vue/component-name-in-template-casing': ['error', 'PascalCase'],
    'vue/no-v-html': 'off',
    // TypeScript 相关
    'ts/no-unused-vars': 'off',
    'ts/explicit-function-return-type': 'off',
    'ts/no-explicit-any': 'warn',
    // 关闭与 Prettier 冲突的规则
    'style/semi': 'off',
    'style/quotes': 'off',
    'style/indent': 'off',
  },
  formatters: {
    css: true,
    html: true,
    prettier: true,
  },
})
